package config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Data
@ConfigurationProperties(prefix = DisruptorProperties.PREFIX)
public class DisruptorProperties {

    public static final String PREFIX = "spring.disruptor";

    private boolean enabled = false;
    /** RingBuffer缓冲区大小,通常设置为2的次方整数，默认 1024 */
    private int ringBufferSize = 1024;
    /** 消息消费线程池大小, 默认 4 */
    private int ringThreadNumbers = 4;
    private String ringThreadName = "";
    private Boolean Daemon = false;
    /** 是否对生产者，如果是则通过 RingBuffer.createMultiProducer创建一个多生产者的RingBuffer，否则通过RingBuffer.createSingleProducer创建一个单生产者的RingBuffer */
    private Boolean multiProducer = false;
    //等待策略 支持 blocking，sleeping，yielding，busyspin
    private String waitStraegys = "yielding";
}
